﻿<%@ Page Title="Editar Usuario" Language="C#" MasterPageFile="~/MasterPage.master"
	AutoEventWireup="true" CodeFile="EditUser.aspx.cs" Inherits="User_EditUser" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="../Location/EditLocation.ascx" TagName="EditLocation" TagPrefix="uc1" %>
<%@ Register Src="../BasicReference/EditBasicReferenceValues.ascx" TagName="EditBasicReferenceValues"
	TagPrefix="uc2" %>
<asp:Content ID="cntContenido" ContentPlaceHolderID="cntContenido" runat="Server">
	<asp:Panel ID="pnlForm" CssClass="divForm" runat="server" DefaultButton="btnSave">
		<div class="header">
			<div class="icon">
			</div>
			<div class="title">
				<asp:Label ID="lblTitle" runat="server" meta:resourcekey="lblTitle"></asp:Label>
			</div>
			<div class="subtitle">
				Diligencie los campos para editar los datos del usuario
			</div>
		</div>
		<asp:UpdatePanel ID="updFields" runat="server" UpdateMode="Conditional">
			<Triggers>
				<asp:AsyncPostBackTrigger ControlID="btnClear" />
			</Triggers>
			<ContentTemplate>
				<asp:TabContainer ID="tabContainer" CssClass="tabContainer" runat="server">
					<asp:TabPanel ID="tabStep_1" runat="server" HeaderText="Datos del Usuario">
						<ContentTemplate>
							<div class="divColField">
								<div class="divField">
									<div class="label">
										Nombre Completo</div>
									<div class="divSubField">
										<div class="label">
											<asp:Label ID="lbltitUserFirstName" runat="server" meta:resourcekey="lbltitUserFirstName"></asp:Label>
											<asp:RequiredFieldValidator ID="rfvtxtUserFirstName" SetFocusOnError="True" runat="server"
												ControlToValidate="txtUserFirstName" ErrorMessage="Diligencie el Primer Nombre"></asp:RequiredFieldValidator>
										</div>
										<div class="field">
											<asp:TextBox ID="txtUserFirstName" runat="server" MaxLength="20" CssClass="W200"></asp:TextBox>
										</div>
									</div>
									<div class="divSubField">
										<div class="label">
											<asp:Label ID="lbltitUserSecondName" runat="server" meta:resourcekey="lbltitUserSecondName"></asp:Label>
										</div>
										<div class="field">
											<asp:TextBox ID="txtUserSecondName" runat="server" MaxLength="20" CssClass="W200"></asp:TextBox>
										</div>
									</div>
									<div class="divSubField">
										<div class="label">
											<asp:Label ID="lbltitUserSurName" runat="server" meta:resourcekey="lbltitUserSurName"></asp:Label>
											<asp:RequiredFieldValidator ID="rfvtxtUserSurName" runat="server" SetFocusOnError="True"
												ControlToValidate="txtUserSurName" ErrorMessage="Diligencie el Primer Apellido"></asp:RequiredFieldValidator>
										</div>
										<div class="field">
											<asp:TextBox ID="txtUserSurName" runat="server" MaxLength="20" CssClass="W200"></asp:TextBox>
										</div>
									</div>
									<div class="divSubField">
										<div class="label">
											<asp:Label ID="lbltitUserLastName" runat="server" meta:resourcekey="lbltitUserLastName"></asp:Label>
										</div>
										<div class="field">
											<asp:TextBox ID="txtUserLastName" runat="server" MaxLength="20" CssClass="W200"></asp:TextBox>
										</div>
									</div>
								</div>
								<div class="divField">
									<div class="label">
										<asp:Label ID="lbltitUserEnterprise" runat="server">Entidad</asp:Label>
									</div>
									<div class="field">
										<asp:TextBox ID="txtUserEnterprise" MaxLength="100" runat="server"></asp:TextBox>
										<div class="instructions">
											Diligencie uno de los siguientes según le corresponda:<br />
											Corporación, Juzgado, Tribunal o Dirección</div>
									</div>
								</div>
								<div class="divField divField_half">
									<div class="label">
										Dependencia</div>
									<div class="field">
										<asp:TextBox ID="txtUserProfession" runat="server" MaxLength="200"></asp:TextBox>
									</div>
								</div>
								<div class="divField divField_half">
									<div class="label">
										Cargo</div>
									<div class="field">
										<asp:TextBox ID="txtUserPosition" runat="server" MaxLength="200"></asp:TextBox>
									</div>
								</div>
								<div class="divField divField_half">
									<div class="label">
										<asp:Label ID="lbltitUserAlias" runat="server" Text="Login"></asp:Label>
										<asp:RequiredFieldValidator ID="rfvtxtUserAlias" SetFocusOnError="True" runat="server"
											ControlToValidate="txtUserAlias" ErrorMessage="Diligencie el Login de Usuario"></asp:RequiredFieldValidator>
									</div>
									<div class="field">
										<asp:TextBox ID="txtUserAlias" runat="server" MaxLength="40" CssClass="W150"></asp:TextBox>
										<asp:Label ID="lblinsUserAlias" CssClass="instructions" runat="server" meta:resourcekey="lblinsUserAlias"></asp:Label>
									</div>
								</div>
								<div class="divField divField_half" style="height: 100px;">
									<div class="label">
										<asp:Label ID="lbltitUserPassword" runat="server" meta:resourcekey="lbltitUserPassword"></asp:Label>
									</div>
									<div class="field">
										<asp:Button ID="btnAutoResetPassword" runat="server" Text="Reiniciar Contraseña"
											OnClick="btnAutoResetPassword_Click" CausesValidation="False" />
										<asp:ConfirmButtonExtender ID="btnAutoResetPassword_Confirm" ConfirmText="Confirma que desea reiniciar la contraseña del usuario?"
											TargetControlID="btnAutoResetPassword" runat="server" Enabled="True">
										</asp:ConfirmButtonExtender>
										<asp:Button ID="btnChangePassword" Visible="False" runat="server" Text="Cambiar Contraseña"
											UseSubmitBehavior="False" CausesValidation="False" OnClick="btnChangePassword_Click" />
									</div>
								</div>
								<div class="divField divField_half" id="divUserIsEnabled" runat="server">
									<div class="label">
										<asp:Label ID="lbltitUserIsEnabled" runat="server" Text="Habilitado"></asp:Label></div>
									<div class="field">
										<asp:CheckBox ID="chkUserIsEnabled" runat="server" />
									</div>
								</div>
							</div>
							<div class="divColField">
								<div class="divField divField_half">
									<div class="label">
										<asp:Label ID="lbltitUserIdentificationType" runat="server" meta:resourcekey="lbltitUserIdentificationType"></asp:Label>
										<asp:RequiredFieldValidator ID="rfvddlUserIdentificationType" runat="server" SetFocusOnError="True"
											ControlToValidate="ddlUserIdentificationType" ErrorMessage="Seleccione el Tipo de Identificación"></asp:RequiredFieldValidator>
									</div>
									<div class="field">
										<asp:DropDownList ID="ddlUserIdentificationType" Width="214px" runat="server">
										</asp:DropDownList>
									</div>
								</div>
								<div class="divField divField_half">
									<div class="label">
										<asp:Label ID="lbltitUserIdentificationNumber" runat="server" meta:resourcekey="lbltitUserIdentificationNumber"></asp:Label>
										<asp:RequiredFieldValidator ID="rfvtxtUserIdentificationNumber" runat="server" SetFocusOnError="True"
											ControlToValidate="txtUserIdentificationNumber" ErrorMessage="Diligencie el Número de Identificación"></asp:RequiredFieldValidator>
									</div>
									<div class="field">
										<asp:TextBox ID="txtUserIdentificationNumber" runat="server" MaxLength="20"></asp:TextBox>
									</div>
								</div>
								<div class="divField">
									<div class="label">
										<asp:Label ID="lbltitUserEmail" runat="server" meta:resourcekey="lbltitUserEmail"></asp:Label>
										<asp:RequiredFieldValidator ID="rfvtxtUserEmail" runat="server" ControlToValidate="txtUserEmail"
											SetFocusOnError="True" ErrorMessage="Diligencie el Correo Electrónico"></asp:RequiredFieldValidator>
										<asp:RegularExpressionValidator ID="revtxtUserEmail" runat="server" ErrorMessage="Correo Electrónico inválido"
											meta:resourcekey="revtxtUserEmail" SetFocusOnError="True" ControlToValidate="txtUserEmail"
											ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
									</div>
									<div class="field">
										<asp:TextBox ID="txtUserEmail" runat="server" MaxLength="150"></asp:TextBox>
									</div>
								</div>
								<uc1:EditLocation ID="uscUserEditLocation" runat="server" />
								<div class="divField">
									<div class="label">
										<asp:Label ID="lbltitUserSecurityQuestion" runat="server" meta:resourcekey="lbltitUserSecurityQuestion"></asp:Label>
										<asp:RequiredFieldValidator ID="rfvddlUserSecurityQuestion" SetFocusOnError="True"
											runat="server" ControlToValidate="ddlUserSecurityQuestion" ErrorMessage="Seleccione la Pregunta de Seguridad"></asp:RequiredFieldValidator>
									</div>
									<div class="field">
										<asp:DropDownList ID="ddlUserSecurityQuestion" CssClass="W300" runat="server">
										</asp:DropDownList>
										<asp:Label ID="lblinsUserSecurityQuestion" CssClass="instructions" runat="server"
											meta:resourcekey="lblinsUserSecurityQuestion"></asp:Label>
									</div>
								</div>
								<div class="divField">
									<div class="label">
										<asp:Label ID="lbltitUserSecurityQuestionAnswer" runat="server" meta:resourcekey="lbltitUserSecurityQuestionAnswer"></asp:Label>
										<asp:RequiredFieldValidator ID="rfvtxtUserSecurityQuestionAnswer" SetFocusOnError="True"
											runat="server" ControlToValidate="txtUserSecurityQuestionAnswer" ErrorMessage="Diligencie la Respuesta a la Pregunta de Seguridad"></asp:RequiredFieldValidator>
									</div>
									<div class="field">
										<asp:TextBox ID="txtUserSecurityQuestionAnswer" MaxLength="30" CssClass="W300" runat="server"></asp:TextBox>
										<asp:Label ID="lblinsUserSecurityQuestionAnswer" runat="server" CssClass="instructions"
											meta:resourcekey="lblinsUserSecurityQuestionAnswer"></asp:Label>
									</div>
								</div>
							</div>
							<div class="divField divField_half" style="display: none;">
								<div class="label">
									<asp:Label ID="lbltitUserGender" runat="server" meta:resourcekey="lbltitUserGender"></asp:Label>
									<asp:RequiredFieldValidator ID="rfvddlUserGender" Enabled="False" runat="server"
										ControlToValidate="ddlUserGender" SetFocusOnError="True" ErrorMessage="Seleccione el Sexo"></asp:RequiredFieldValidator>
								</div>
								<div class="field">
									<asp:DropDownList ID="ddlUserGender" runat="server" CssClass="W100">
									</asp:DropDownList>
								</div>
							</div>
							<div class="divField divField_half" style="display: none;">
								<div class="label">
									<asp:Label ID="lbltitUserBirthDate" runat="server" meta:resourcekey="lbltitUserBirthDate"></asp:Label>
									<asp:RequiredFieldValidator ID="rfvtxtUserBirthDate" runat="server" ControlToValidate="txtUserBirthDate"
										SetFocusOnError="True" ErrorMessage="Diligencie la Fecha de Nacimiento" Enabled="False"></asp:RequiredFieldValidator>
									<asp:RegularExpressionValidator ID="revtxtUserBirthDate" runat="server" meta:resourcekey="revtxtUserBirthDate"
										Text="*" Display="Dynamic" ValidationExpression="^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$"
										ControlToValidate="txtUserBirthDate"></asp:RegularExpressionValidator>
								</div>
								<div class="field ">
									<asp:TextBox ID="txtUserBirthDate" runat="server" CssClass="W100" MaxLength="10"></asp:TextBox>
									<asp:Label ID="lblinsUserBirthDate" runat="server" CssClass="instructions" meta:resourcekey="lblinsUserBirthDate"></asp:Label>
									<asp:CalendarExtender ID="txtUserBirthDate_CalendarExtender" runat="server" Enabled="True"
										PopupButtonID="imgUserBirthDate" TargetControlID="txtUserBirthDate" Format="yyyy-MM-dd">
									</asp:CalendarExtender>
									<asp:ImageButton ID="imgUserBirthDate" ImageUrl="~/Images/Icons/icoCalendar.png"
										CausesValidation="False" runat="server" />
								</div>
							</div>
						</ContentTemplate>
					</asp:TabPanel>
					<asp:TabPanel ID="tabUserGroups" runat="server" HeaderText="Grupos">
						<ContentTemplate>
							<div class="divField">
								<div class="label">
									Pertenencia a Grupos</div>
								<div class="field">
									<asp:CheckBoxList ID="chkUserGroups" CssClass="W300" runat="server">
									</asp:CheckBoxList>
								</div>
							</div>
						</ContentTemplate>
					</asp:TabPanel>
					<asp:TabPanel ID="tabRights" runat="server" HeaderText="Permisos">
						<ContentTemplate>
							<uc2:EditBasicReferenceValues ID="uscEditRights" runat="server" />
						</ContentTemplate>
					</asp:TabPanel>
					<asp:TabPanel ID="tabExtraStep" HeaderText="Otros Datos" runat="server">
						<ContentTemplate>
							<iframe id="ifrExtraStep" runat="server" style="width: 90%; height: 100px; margin-top: 4px;"
								frameborder="0" scrolling="no"></iframe>
						</ContentTemplate>
					</asp:TabPanel>
					<asp:TabPanel ID="tabAuditory" runat="server" HeaderText="Auditoria">
						<ContentTemplate>
							<div class="divField">
								<div class="label">
									Creación
								</div>
								<div class="field">
									<asp:Label ID="lblUserCreationAlias" runat="server"></asp:Label>
									<asp:Label ID="lblCreationDateTime" runat="server"></asp:Label>
								</div>
							</div>
							<div class="divField">
								<div class="label">
									Última Actualización
								</div>
								<div class="field">
									<asp:Label ID="lblUserLastUpdateAlias" runat="server"></asp:Label>
									<asp:Label ID="lblLastUpdateDateTime" runat="server"></asp:Label>
								</div>
							</div>
						</ContentTemplate>
					</asp:TabPanel>
				</asp:TabContainer>
			</ContentTemplate>
		</asp:UpdatePanel>
		<asp:UpdatePanel ID="updNewPassword" runat="server">
			<ContentTemplate>
				<asp:Panel ID="divChangePassword" Visible="false" runat="server" CssClass="divForm divPopup"
					DefaultButton="btnSetNewPassword">
					<div class="header">
						<div class="title">
							<span>Cambio de Contraseña</span>
						</div>
					</div>
					<div class="divField divField_half">
						<div class="label">
							Contraseña Nueva *
							<asp:RequiredFieldValidator ID="rfvtxtNewPassword" runat="server" ControlToValidate="txtNewPassword"
								ValidationGroup="valNewPassword" ErrorMessage="Diligencie la nueva contraseña"
								Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
						</div>
						<div class="field">
							<asp:TextBox ID="txtNewPassword" MaxLength="20" runat="server" TextMode="Password"></asp:TextBox>
						</div>
					</div>
					<div class="divOperations">
						<asp:Button ID="btnSetNewPassword" runat="server" ToolTip="Define una nueva contraseña para su usuario"
							Text="Cambiar" ValidationGroup="valNewPassword" OnClick="btnSetNewPassword_Click" />
						<asp:ConfirmButtonExtender ID="cfebtnSetNewPassword" ConfirmText="Confirma que desea cambiar la contraseña de su usuario?"
							TargetControlID="btnSetNewPassword" runat="server">
						</asp:ConfirmButtonExtender>
						<asp:Button ID="btnCancel" runat="server" UseSubmitBehavior="false" ToolTip="No cambia la contraseña"
							Text="Cancelar" CausesValidation="false" OnClick="btnCancelNewPassword_Click" />
					</div>
				</asp:Panel>
			</ContentTemplate>
		</asp:UpdatePanel>
		<div class="divOperations">
			<asp:UpdatePanel ID="updOperations" runat="server" UpdateMode="Conditional">
				<ContentTemplate>
					<asp:CustomValidator ID="cvlIframeOtherApps" runat="server" Text=""></asp:CustomValidator>
					<asp:HiddenField ID="hidBasicReferenceTypeID" runat="server" />
					<asp:CheckBox ID="chkNotifyUserEmail" Width="120px" Checked="true" runat="server" Text="Notificar Cambios"
						ToolTip="Le envia un email al usuario indicandole que hubo cambios en su cuenta - al momento de guardar -" />
					&nbsp;&nbsp;&nbsp;&nbsp;
					<asp:Button ID="btnSave" runat="server" Text="Guardar" OnClick="btnSave_Click" />
					<asp:Button ID="btnClear" CausesValidation="false" UseSubmitBehavior="false" runat="server"
						Text="Nuevo" OnClick="btnClear_Click" />
					<asp:Button ID="btnGoBack" UseSubmitBehavior="false" runat="server" Text="Volver"
						CausesValidation="false" />
				</ContentTemplate>
			</asp:UpdatePanel>
		</div>
	</asp:Panel>
</asp:Content>
